Markup |
<apex:page showHeader="true" sidebar="false" standardStylesheets="false" tabStyle="OmniScriptHome__tab" controller="omnistudio.OmniScriptHomeController"
extensions="omnistudio.DRDataPackRunnerController,omnistudio.OmniScriptDesignerController" docType="html-5.0" applyBodyTag="false" title="Omniscript Designer Home"
action="{!checkIfOmniHomeIsFirstInstalledPackage}">
<head>
<script src="{!URLFOR($Resource.vlocity_core_assets, '/latest/vlocity_core_assets.js')}"></script>
<apex:includeScript value="{!$Resource.omnistudio__angular_bundle_1_6}" />
<script src="{!URLFOR($Resource.angular_strap_bundle_1_6)}"></script>
<apex:includeScript value="{!URLFOR($Resource.omnistudio__vlocity_assets, '/bower_components/ng-table/dist/ng-table.js')}" />
<apex:includeScript value="{!URLFOR($Resource.omnistudio__ngInfiniteScroll, '/build/ng-infinite-scroll.min.js')}" />
<apex:stylesheet value="{!URLFOR($Resource.omnistudio__vlocity_assets, '/css/vlocity.css')}" />
<apex:stylesheet value="{!IF(isLanguageRTL, URLFOR($Resource.omnistudio__slds, '/assets/styles/salesforce-lightning-design-system-vf.rtl.min.css'), URLFOR($Resource.omnistudio__slds, '/assets/styles/salesforce-lightning-design-system-vf.min.css'))}"
/>
<apex:includeScript value="{!$Resource.omnistudio__SldsAngular}" />
<apex:includeScript value="{!$Resource.omnistudio__DRVComp}" />
<apex:includeScript value="/support/console/42.0/integration.js" />
<script type="text/javascript">
window.omniLwcCompilerConfig = {
namespacePrefix: '{!namespace}',
isInsidePckg: '{!isInsidePckg}',
remoteActions: {
buildJSONWithPrefillV2: {
action: "{!$RemoteAction.OmniScriptDesignerController.BuildJSONWithPrefillV2}",
config: { buffer: false, escape: false }
}
}
};
window.industryPkgNSPrefix = '{!industryPkgNSPrefix}';
</script>
<script src="{!$Resource.OmniscriptLwcCompiler}"></script>
<apex:includeScript value="{!$Resource.omnistudio__OmniScriptHome}" />
<apex:includeLightning />
</head>
<style>
html.Theme4d body,
html.Theme4u body {
margin: 0;
}
html:not(.Theme3) body.sfdcBody {
margin: 0;
padding: 0;
overflow-x: hidden;
}
.bodyDiv .noSidebarCell {
padding: 0;
}
</style>
<script>
(function () {
document.documentElement.classList.add('{!$User.UIThemeDisplayed}');
})();
</script>
<body xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<div ng-app="ouihome" class="via-slds ng-cloak {!$User.UIThemeDisplayed}" ng-controller="ouihome">
<!-- NOTE: "{!$ObjectType.OmniProcess.Name}" will be automatically fixed by Make on deploy -->
<slds-home new-url="'{!newUrl}'" search-columns="searchColumns" page-title="'OmniScripts'" s-object-type="'{!omniScriptObjType}'"
row-actions="rowActions" group-by="groupBy" sorting="sorting" id-prefix="omni-home" backcompat-import="backcompatImport(json, done)"
default-columns="defaultColumns" additional-table-buttons="additionalTableButtons" extra-filters="extraFilters"
new-designer-customization-buttons="newDesignerCustomizationButtons" load-file-based-omni-scripts="{!isFoundationPackage}">
</slds-home>
</div>
<script type="text/javascript">
/* START_VLOC_I18N */
var i18n = {
OmniDesLwcDeployError: '{!JSENCODE($Label.OmniDesLwcDeployError)}',
OmniDesMissingType: '{!JSENCODE($Label.OmniDesMissingType)}',
OmniDesMissingSubType: '{!JSENCODE($Label.OmniDesMissingSubType)}',
OmniDesMissingLanguage: '{!JSENCODE($Label.OmniDesMissingLanguage)}',
OmniDesLwcDeactivateDeployError: '{!JSENCODE($Label.OmniDesLwcDeactivateDeployError)}',
OmniDesConfirmActivationWithLwc: '{!JSENCODE($Label.OmniDesConfirmActivationWithLwc)}',
OmniDesOk: '{!JSENCODE($Label.OmniDesOk)}',
OmniDesCancel: '{!JSENCODE($Label.OmniDesCancel)}',
OmniDesActivation: '{!JSENCODE($Label.OmniDesActivation)}',
OmniDesActivationError: '{!JSENCODE($Label.OmniDesActivationError)}',
OmniDesActivationValidationError: '{!JSENCODE($Label.OmniDesActivationValidationError)}',
ActivateOmniscriptLwcComponentsMessage: '{!JSENCODE($Label.ActivateOmniscriptLwcComponentsMessage)}'
};
/* END_VLOC_I18N */
</script>
<c:VFActionFunction />
<div class="via-slds" id="custom-slds-home-new-modal" style="display: none">
<div id="lightning" />
</div>
<script>
window.omniIsFoundationPackage = {!isFoundationPackage};
window.omniNewUrl = "{!newUrl}";
window.previewUrl = "{!previewUrl}"
window.omniLwcNewUrl = `/lightning/cmp/{!namespacePrefix}OmniDesignerAuraWrapper?c__recordId=`;
window.omniLwcMetadataUrl = `/lightning/cmp/{!namespacePrefix}OmniDesignerAuraWrapper?c__uniqueName=`;
window.showLegacyOmniStudioUi = {!showLegacyOmniStudioUi};
window.isFoundationPkg = {!isFoundationPackage};
window.newOutSideFeatureUrl = "/lightning/cmp/{!namespacePrefix}OmniDesignerCustomizationNewFormAuraWrapper?c__componentName=";
window.omniDesignerCustomizationTypes = JSON.parse('{!JSENCODE(getNewDesignerCustomizationTypes)}');
if (typeof sforce !== 'undefined') {
if (sforce.console && sforce.console.isInConsole()) {
sforce.console.setTabTitle('Omniscript Designer');
sforce.console.setTabIcon('standard:template');
}
}
var ns = "{!namespacePrefix}".replace('__', '');
$Lightning.use(`${ns}:ltngOutVF`, function () {
creatNewForm();
});
function creatNewForm() {
$Lightning.createComponent(`${ns}:omniDesignerNewOmniScriptForm`,
{
objectApiName: '{!JSENCODE(omniObjectNameWithNamespace)}',
isNavigationApiUnsupported: true
},
"lightning",
function (cmp, status) {
if (status === "SUCCESS") {
const newform = document.getElementById('lightning');
newform.addEventListener('omninewnavigate', function (event) {
// enable when we want the new designer to be the default.
if (event.detail.isLwcEnabled) {
vlocityOpenUrl(`${omniLwcNewUrl}${event.detail.recordId}`, null, false);
} else {
vlocityOpenUrl(`${omniNewUrl}?id=${event.detail.recordId}`, null, false);
}
event.stopPropagation();
event.preventDefault();
});
newform.addEventListener('close', function (event) {
cmp.destroy();
Promise.resolve().then(() => {
const modalWrapper = document.getElementById('custom-slds-home-new-modal');
modalWrapper.style.display = 'none';
const newLightningEl = document.createElement('div');
newLightningEl.id = 'lightning';
modalWrapper.innerHTML = null;
modalWrapper.appendChild(newLightningEl);
creatNewForm();
});
});
document.querySelector("#auraErrorMessage").innerHTML = "";
}
}
);
}
</script>
<script>
angular.module('ouihome.core', [])
.value('OmniScriptFieldMappingsNamespace', JSON.parse('{!JSENCODE(omniScriptFieldMappingsNamespace)}'))
</script>
</body>
</apex:page> |